package com.bytedance.scenedemo.navigation.reuse;

import com.bytedance.scene.group.ReuseGroupScene;
import ohos.aafwk.content.Intent;
import ohos.agp.colors.RgbColor;
import ohos.agp.components.ComponentContainer;
import ohos.agp.components.LayoutScatter;
import ohos.agp.components.StackLayout;
import ohos.agp.components.element.ShapeElement;

/**
 * Created by JiangQi on 8/13/18.
 */
public class ReuseScene1 extends ReuseGroupScene {
    @Override
    protected ComponentContainer onCreateNewView(LayoutScatter inflater, ComponentContainer container, Intent savedInstanceState) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
            Thread.currentThread().interrupt();
        }
        StackLayout stackLayout=new StackLayout(getAbility());
        ShapeElement shapeElement=new ShapeElement();
        shapeElement.setRgbColor(RgbColor.fromArgbInt(0xFFFFFF00));
        stackLayout.setBackground(shapeElement);
        return stackLayout;
    }
}
